package com.oazon.moco.link.ui;

import java.util.Arrays;

import com.oazon.moco.link.core.LinkEvent;
import com.oazon.moco.link.core.LinkEventListener;
import com.oazon.moco.link.core.source.LinkEventSource;
import com.oazon.moco.link.event.ResponceEvent;
import com.oazon.moco.link.event.ResponceStatus;

public class ResponceEventListener extends LinkEventListener{

	private static final String TAG = "ResponceEventListener";
	
	public ResponceEventListener(LinkEventSource... sources){
		setBlackList(Arrays.asList(sources));
	}
	
	@Override
	public void onLinkEvent(LinkEvent event) {
		if(!filter((LinkEventSource)event.getSource())||!(event instanceof ResponceEvent)){
			return;
		}
		
		ResponceEvent responceEvent = (ResponceEvent) event;
		
		if(responceEvent.getResponceStatus() == ResponceStatus.HARDWARE_VERSION){
			responseHardwareVersion(responceEvent.getHardwareVersion());
		}
	}

	/**
	 * 得到硬件版本号
	 * @param version
	 * @param ctx
	 */
	protected void responseHardwareVersion(String version) {
		
	}
}
